package com.chang.rentmall.controllers;

import com.chang.rentmall.beans.BaseBean;
import com.chang.rentmall.beans.MessageBean;
import com.chang.rentmall.beans.ShopTypeBean;
import com.chang.rentmall.servicesImpl.ShopTypeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ShopTypeController {
    @Autowired
    ShopTypeServiceImpl shopTypeService;

    @RequestMapping(value = "shopType/add", method = {RequestMethod.POST})
    public MessageBean addShopType (@RequestBody BaseBean<ShopTypeBean> baseBean) {
        return shopTypeService.addShopType(baseBean);
    }

    @RequestMapping(value = "shopType/delete", method = {RequestMethod.POST})
    public MessageBean deleteShoptype (@RequestBody BaseBean<ShopTypeBean> baseBean) {
        return shopTypeService.deleteSopType(baseBean);
    }

    @RequestMapping(value = "shopType/list", method = {RequestMethod.POST})
    public MessageBean getShopTypes (@RequestBody BaseBean<ShopTypeBean> baseBean) {
        return shopTypeService.getShopTypes(baseBean);
    }
}
